const url = require('url')
const spiderModel = require('../models/spider')

const getList = async (req, res) => {

	const parseObj = url.parse(req.url, true);
	// 请求参数解构
	// console.log(parseObj.query);
	// pagesize, pagenum

	let data = await spiderModel.findList(parseObj.query)
	let result = {
		state: 0,
		data: data.data,
		totalNum: data.totalNum
	};
	res.writeHead(200, { "Content-Type": "application/json;charset=utf-8" });
	res.end(JSON.stringify(result));
}


const addOne = async (req, res) => {

}

exports.getList = getList
exports.addOne = addOne
